class Book{
    var bookname:String=""
    var books=Map("Flipped "->true)
    var author:String=""

    def borrow(name:String):Unit={
        books+=(name -> false)
    }

    def Return(name:String):Unit={
        books+=(name->true)
    }
}

object Bookr{
	def apply(bookname:String,author:String,books:Map)= {
                          new Car(bookname,author,books)
                  }
	def unapply(book:Book):Option[(String,String,Map)]={
                           Some((book.bookname,book.author,book.books))
                 }
}

class Library{
    var available:List[String]=List()
    var useless:List[String]=List()

    def add(name:String):Unit={
        available=available:+name
    }

    def   delbook(name:String):Unit={
        available=available.filter(_!=name)
        useless=useless:+name
    }

    def returnbook(name:String):Unit={
        available=available:+name
        useless=useless.filter(_!=name)
    }
}
